home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
vblank1d.arc
/
VBLANK.LST
< prev
next >
Wrap
File List
|
1990-10-05
|
7KB
|
174 lines
Microsoft (R) Macro Assembler Version 5.10 10/5/90 12:26:28
Page 1-1
PAGE 78,132
; ---------- VBLANK VGA Screen Blanker
; ---------- Version 1d
; ---------- Placed in the public domain by
; ---------- Richard M. Utter, ProLogic, Scottsville, New York
; ---------- 3 September 1990
; ----------
; ---------- Fine Print: There's no charge. Neither is there a warranty.
; ----------
; ---------- VBLANK.EXE is a TSR designed to blank a VGA monitor after a
; ---------- fixed interval. Pressing any key will unblank the monitor. RAM
; ---------- required is about 500 bytes.
; ----------
; ---------- Assemble VBLANK.ASM with MASM 5.1. Then link VBLANK.OBJ any old
; ---------- way. Use Microsoft's EXEMOD or a similar utility to reduce
; ---------- VBLANK.EXE's memory requirement to the minimum. (For EXEMOD, the
; ---------- command would be "EXEMOD VBLANK.EXE /MAX 0".) Run VBLANK from the
; ---------- DOS command line or via AUTOEXEC.BAT.
; ----------
; ---------- Timer threshold: 5000 / 18.2 = 275 seconds or thereabouts. The
; ---------- VGA monitor will be blanked after roughly 4.5 minutes of keyboard
; ---------- inactivity.
= 1388 MAXT EQU 5000
.MODEL SMALL
; ---------- "Short stack."
.STACK 16
.CODE
0000 TSR PROC FAR
0000 EB 0A JMP SHORT _1000
0002 00000000 OLD_1C DD 0
0006 00000000 OLD_09 DD 0
000A 0000 TCOUNT DW 0
; ---------- Grab old INT 1C and 9 vectors before replacing them.
000C B8 351C _1000: MOV AX,351CH
000F CD 21 INT 21H
0011 2E: 89 1E 0002 R MOV WORD PTR OLD_1C,BX
0016 2E: 8C 06 0004 R MOV WORD PTR OLD_1C+2,ES
001B B8 3509 MOV AX,3509H
001E CD 21 INT 21H
0020 2E: 89 1E 0006 R MOV WORD PTR OLD_09,BX
0025 2E: 8C 06 0008 R MOV WORD PTR OLD_09+2,ES
; ---------- Point INT 8 and 9 at our interrupt routines.
002A 0E PUSH CS
002B 1F POP DS
002C B8 251C MOV AX,251CH
002F BA 0044 R MOV DX,OFFSET INTTIME
0032 CD 21 INT 21H
0034 B8 2509 MOV AX,2509H
0037 BA 0074 R MOV DX,OFFSET INTKB
003A CD 21 INT 21H
; ---------- "Terminate and stay resident", reserving 432 bytes for ourselves.
; ---------- 432 is a bit more than 256 + 157 + 16 (PSP plus code size plus
; ---------- stack size).
003C B8 3100 MOV AX,3100H
003F BA 001B MOV DX,27
0042 CD 21 INT 21H
0044 TSR ENDP
; ---------- Timer ISR.
0044 INTTIME PROC FAR
; ---------- Save DS before pointing it at local data.
0044 1E PUSH DS
0045 0E PUSH CS
0046 1F POP DS
; ---------- Screen already blanked?
0047 2E: 81 3E 000A R 1388 CMP TCOUNT,MAXT
; ---------- Yes. Go away.
004E 74 1E JE _2000
; ---------- Increment and test counter.
0050 2E: 83 06 000A R 01 ADD TCOUNT,1
0056 2E: 81 3E 000A R 1388 CMP TCOUNT,MAXT
005D 7C 0F JL _2000
Microsoft (R) Macro Assembler Version 5.10 10/5/90 12:26:28
Page 1-2
; ---------- We've reached the threshold. Disable VGA screen refresh.
005F 50 PUSH AX
0060 52 PUSH DX
0061 B0 01 MOV AL,1
0063 BA 03C4 MOV DX,3C4H
0066 EE OUT DX,AL
0067 42 INC DX
0068 EC IN AL,DX
0069 0C 20 OR AL,20H
006B EE OUT DX,AL
006C 5A POP DX
006D 58 POP AX
; ---------- Restore DS to entry value, then vector to old timer ISR.
006E 1F _2000: POP DS
006F 2E: FF 2E 0002 R JMP OLD_1C
0074 INTTIME ENDP
; ---------- K/B ISR.
0074 INTKB PROC FAR
0074 1E PUSH DS
0075 0E PUSH CS
0076 1F POP DS
; ---------- Is the screen blanked? If not, unblanking it is redundant.
0077 2E: 81 3E 000A R 1388 CMP TCOUNT,MAXT
007E 7C 0F JL _3000
; ---------- Screen is blanked. Enable VGA screen refresh.
0080 50 PUSH AX
0081 52 PUSH DX
0082 B0 01 MOV AL,1
0084 BA 03C4 MOV DX,3C4H
0087 EE OUT DX,AL
0088 42 INC DX
0089 EC IN AL,DX
008A 24 DF AND AL,NOT 20H
008C EE OUT DX,AL
008D 5A POP DX
008E 58 POP AX
; ---------- Zero the counter.
008F 2E: C7 06 000A R 0000 _3000: MOV TCOUNT,0
0096 1F POP DS
; ---------- Vector to the real K/B ISR.
0097 2E: FF 2E 0006 R JMP OLD_09
009C INTKB ENDP
END TSR
Microsoft (R) Macro Assembler Version 5.10 10/5/90 12:26:28
Symbols-1
Segments and Groups:
N a m e Length Align Combine Class
DGROUP . . . . . . . . . . . . . GROUP
_DATA . . . . . . . . . . . . 0000 WORD PUBLIC 'DATA'
STACK . . . . . . . . . . . . 0010 PARA STACK 'STACK'
_TEXT . . . . . . . . . . . . . 009C WORD PUBLIC 'CODE'
Symbols:
N a m e Type Value Attr
INTKB . . . . . . . . . . . . . F PROC 0074 _TEXT Length = 0028
INTTIME . . . . . . . . . . . . F PROC 0044 _TEXT Length = 0030
MAXT . . . . . . . . . . . . . . NUMBER 1388
OLD_09 . . . . . . . . . . . . . L DWORD 0006 _TEXT
OLD_1C . . . . . . . . . . . . . L DWORD 0002 _TEXT
TCOUNT . . . . . . . . . . . . . L WORD 000A _TEXT
TSR . . . . . . . . . . . . . . F PROC 0000 _TEXT Length = 0044
@CodeSize . . . . . . . . . . . TEXT 0
@Cpu . . . . . . . . . . . . . . TEXT 0101h
@DataSize . . . . . . . . . . . TEXT 0
@FileName . . . . . . . . . . . TEXT VBLANK
@Version . . . . . . . . . . . . TEXT 510
@code . . . . . . . . . . . . . TEXT _TEXT
_1000 . . . . . . . . . . . . . L NEAR 000C _TEXT
_2000 . . . . . . . . . . . . . L NEAR 006E _TEXT
_3000 . . . . . . . . . . . . . L NEAR 008F _TEXT
118 Source Lines
118 Total Lines
27 Symbols
46762 + 411250 Bytes symbol space free
0 Warning Errors
0 Severe Errors